import useRequest from "@/api/useRequest";

export class storyCharacterController {
    static addCharacter(data:any) :Promise<any> {
      return useRequest({
        url: '/storyCharacter/addStoryCharacter',
        method: 'post',
        data
      })
    }

    static getCharacterList(chapterId:string) : Promise<any>{
      return useRequest({
        url: '/storyCharacter/getStoryCharacterByChapterId?chapterId='+chapterId,
        method:'get'
      })
    }



    static addStoryCharacters(data:any,storyId:string): Promise<any> {
      return useRequest({
        url: '/storyCharacter/saveStoryCharacters',
        method: 'post',
        data,
        params: {
          storyId
        }
      })
    }
  static characterNameExtract(data:any): Promise<any> {
    return useRequest({
      url: "/storyCharacter/extractName",
      method: "post",
      data
    })
  }

  static matchCharacter(data:any): Promise<any> {
    return useRequest({
      url: "/storyCharacter/matchCharacter",
      method: "post",
      data
    })
  }

  static deleteCharacter(characterId:string): Promise<any> {
      return useRequest({
        url: '/storyCharacter/delete?characterId='+characterId,
        method:'get'
      })
  }

}
